<?php

class Default_PiloteController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
    	$piloteDAO = new Application_Model_PiloteDAO();
        $this->view->lettres = $piloteDAO->findListeLettre();
    }
	
    public function showAction()
    {
    	$id = $this->getRequest()->getParam('id');
    	$piloteDAO = new Application_Model_PiloteDAO();
    	$ecurieDAO = new Application_Model_EcurieDAO();
    	$this->view->pilote = $piloteDAO->find((int)$id);
    	$this->view->lettres = $piloteDAO->findListeLettre();
    }
    
    public function listAction()
    {
    	$this->view->lettre = $this->getRequest()->getParam('lettre');
    	$piloteDAO = new Application_Model_PiloteDAO();
        $this->view->pilotes = $piloteDAO->findByLettre($this->getRequest()->getParam('lettre'));
        $this->view->lettres = $piloteDAO->findListeLettre();
    }

}

